home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-0039 / spr_des / source / spr_des1.a68 < prev    next >
Text File  |  1997-04-16  |  1KB  |  56 lines

  1.    org 0
  2. *;Source code to GFA basic
  3. *; by Robert Warnestam, 1988-03-31
  4. *;Print a 16*16 block from a screen (in memory)
  5. *; to the screen
  6. *;Parameters: Poke.L start+ 0,log_screen
  7. *;            Poke.L start+ 4,phys_screen
  8. *;            Poke.B start+ 8,x (0-9)        position in phys_screen
  9. *;            Poke.B start+ 9,y (0-9)
  10. *;            Poke.B start+10,image (0-239)  image in log_screen
  11. *; then: Call start+12
  12. *
  13. *;start
  14. *
  15. var         ds.b  12
  16. *
  17. *;get address to image (in log_screen)
  18. *;addr=8*xi+2560*yi+log
  19. *;xi=image MOD 20, yi=image DIV 20
  20.    lea      var(pc),a2
  21.    move.l   0(a2),a0
  22.    clr.l    d0
  23.    move.b   10(a2),d0
  24.    divu     #20,d0            ;yi in low half, xi in high half
  25.    clr.l    d1
  26.    move.w   d0,d1             ;yi in D1
  27.    swap     d0
  28.    and.l    #$ffff,d0         ;xi in D0
  29.    mulu     #8,d0
  30.    mulu     #2560,d1
  31.    add.l    d0,a0
  32.    add.l    d1,a0
  33. *;get address to output area
  34. *;addr=8*x+2560*y
  35.    move.l   4(a2),a1
  36.    clr.l    d0
  37.    clr.l    d1
  38.    move.b   8(a2),d0
  39.    move.b   9(a2),d1
  40.    mulu     #8,d0
  41.    mulu     #2560,d1
  42.    add.l    d0,a1
  43.    add.l    d1,a1
  44. *;copy 16*16 block
  45.    move.w   #15,d0            ;16 lines
  46. loop  move.l   (a0)+,(a1)+
  47.       move.l   (a0)+,(a1)+
  48.    add.l    #152,a0           ;next line
  49.    add.l    #152,a1
  50.    dbf     d0,loop
  51. *
  52.    rts                        ;back to basic
  53. *
  54.    end
  55.  
  56.